package com.yanghang.controller;

import com.github.pagehelper.PageInfo;
import com.yanghang.entity.Computer;
import com.yanghang.service.ComputerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/computer")
public class ComputerController {
    private int pageSize=3;
    @Autowired
    private ComputerService cs;
    @RequestMapping("/selectByPage")
    @ResponseBody
    public PageInfo<Computer>selectByPage(@RequestParam(defaultValue = "1") int pageNum){
        return cs.selectByPage(pageNum,pageSize);
    }
}
